package com.huarun.module.repair.service.impl;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.huarun.common.BaseServiceImpl;
import com.huarun.common.util.DateUtils;
import com.huarun.module.repair.bean.RepairApply;
import com.huarun.module.repair.bean.RepairRated;
import com.huarun.module.repair.dao.RepairApplyDao;
import com.huarun.module.repair.dao.RepairRatedDao;
import com.huarun.module.repair.service.IRepairApplyService;
import com.huarun.module.repair.service.IRepairRatedService;

/**
 * @author hqy
 * @创建时间   2018-10-26 15:36
 * @Description 报修申请
 */
@Service
public class RepairApplyServiceImpl extends BaseServiceImpl<RepairApplyDao, RepairApply>
		implements IRepairApplyService {
	@Resource
	private RepairApplyDao repairApplyDao;
	
	
	@Override
	public RepairApply getByWorkOrdersGuid(String workOrdersGuid) {
		return repairApplyDao.getByWorkOrdersGuid(workOrdersGuid);
	}


	@Override
	public int save(Map<String, Object> params) {
		RepairApply entity=new RepairApply();
		entity.setPic((String) params.get("path"));
		entity.setRepairCompany((String) params.get("repairCompany"));
		entity.setDescription((String)params.get("description"));
		entity.setRepairType((String)params.get("repairType"));
		entity.setTitle("报修申请");
		entity.setWorkOrdersGuid((String)params.get("workOrdersGuid"));
		
		return repairApplyDao.insert(entity);
	}

}
